package edu.sctu.nieyu.trainsystem;

/**
 * Created by user01 on 2015/6/2.
 */
public class Luggage {

    private String contraband = "易燃易爆物品，炸药，枪械，毒品，管制刀具";
    private Passenger passenger;

    public Luggage(Passenger passenger){
        this.passenger = passenger;
    }

    /**
     * 判断乘客携带行李是否包含违禁物品
     * @return
     */
    public boolean checkLuggage(){
        boolean is_contraband = false;
        if (passenger.isIs_luggage()){
            if (contraband.contains(passenger.getLuggageName())){
                is_contraband = true;
            }
            }else {
            is_contraband = false;
        }
        return is_contraband;
    }

    /**
     * 判断乘客携带液体物品是否包含违禁物品
     * @return
     */
    public boolean checkWater(){
        boolean is_contraband = false;
        if (passenger.isIs_water()){
            if (contraband.contains(passenger.getWaterName())){
                is_contraband = true;
            }
        }else {
            is_contraband = false;
        }
        return is_contraband;
    }
}
